package com.achao.achaomq.listener;

import com.achao.achaomq.constants.RocketMqConstant;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 消费者
 */
@Slf4j
@Component
@RequiredArgsConstructor
@RocketMQMessageListener(topic = RocketMqConstant.ACHAO_TOPIC, consumerGroup = RocketMqConstant.ACHAO_TOPIC, messageModel = MessageModel.CLUSTERING)
public class MqConsumerImpl implements RocketMQListener<String>{

    @Override
    public void onMessage(String message) {
        log.info("listener, 消费数据:{}", message);
    }

}


